package com.cloud.pharmaceuticalClient.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloud.pharmaceuticalClient.pojo.Shopping;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author zhozixiong
 * @date 2023/02/25
 */
@Mapper
@Repository
public interface ShoppingMapper extends BaseMapper<Shopping> {

    Shopping searchAllByUidAndDid(@Param("uid") String uid, @Param("did") Integer did);

    Page<Shopping> searchAllByUid(Page page, @Param("uid") String uid);

    @Override
    int insert(@Param("shopping") Shopping shopping);

    int updateQuantityByUidAndDid(@Param("shopping") Shopping shopping);

    int delByUid(@Param("uid") String uid);

    int delByUidAndDid(@Param("uid") String uid, @Param("did") Integer did);
}
